<template>
	<view>
		<uni-popup ref="toast" :maskClick="close">
			<view style="width: 572rpx;background-color: #a3a3a3;border-radius: 16rpx;" @click="close_toast(false)">
				<view v-if="config.title"
					style="padding-top: 46rpx;font-size: 30rpx;padding-bottom: 20rpx;color: #fff;">
					{{config.title}}
				</view>
				<view class="flex flex-y fs-28"
					style="line-height: 60rpx;padding-left: 50rpx;padding-right: 50rpx;padding-bottom: 60rpx;">
					<view class="center" style="word-break: break-all;color:#fff;white-space: pre-line;">
						{{config.desc}}
					</view>
					<view class="center" style="word-break: break-all;color:#fff;white-space: pre-line;">
						{{config.toasttxt2}}
					</view>
				</view>
				<slot name="center"></slot>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	export default {
		name: "toast",
		data() {
			return {
				old_config: {
					title: '权益说明',
					desc: '', //提示内容
					toasttxt2: ''
				},
				config: {},
			};
		},
		props: {
			close: {
				type: Boolean,
				default: false,
			}
		},
		methods: {
			open(config = {}) {

				this.config = {
					...this.old_config,
					...config
				};
				this.$refs.toast.open();
			},
			close_toast(status) {
				this.$refs.toast.close();
			}
		}
	}
</script>

<style lang="scss">
</style>